package com.huaxin.hxmoduleworkorder.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huaxin.hxmoduleworkorder.common.annotation.validation.ValidMaintenanceOrderPriority;
import com.huaxin.hxmoduleworkorder.common.annotation.validation.ValidMaintenanceOrderStatus;
import com.huaxin.hxmoduleworkorder.common.annotation.validation.ValidOrderType;
import com.huaxin.hxmoduleworkorder.dto.request.base.basePageReqDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class MaintenanceOrderPageListReqDTO extends basePageReqDTO {
    @Schema(description = "工单状态，允许值：created/reviewing/assigned/on_site/processing/resolved/evaluating/completed/rejected/cancelled", defaultValue = "created")
    @ValidMaintenanceOrderStatus
    private String status;

    @Schema(description = "工单类型，允许值：inspection/maintenance/installation", defaultValue = "maintenance")
    @ValidOrderType
    private String type;

    @Schema(description = "工单优先级，允许值：low/medium/high/urgent", defaultValue = "high")
    @ValidMaintenanceOrderPriority
    private String priority;

    @Schema(description = "客户ID")
    private String customerId;

    @Schema(description = "电工ID")
    private String electricianId;

    @Schema(description = "设备ID")
    private String equipmentId;

    @Schema(description = "关键字查询，支持标题、描述查询")
    private String keyword;

    @Schema(description = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    @Schema(description = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;
}
